% Define coordinate ranges
% x_min = 0; x_max = 10; % Example range for x
% y_min = 5; y_max = 20; % Example range for y
% load('yourData.mat'); % Load the matrix, assuming it contains a variable F

% F = glbl_optm;  %%%%%%%%%%%%%%%%%%%%%%%%% edit
% F = conv_step;
% F = conv_rate;

F = zeros(29,13);
for i = 1:29
    for j = 1:13
        if conv_step(i,j) ~= 0
            F(i,j) = 1*conv_rate(i,j)*glbl_optm(i,j)/conv_step(i,j);    % performance index
        else
            F(i,j) = 0;
        end
    end
end

F = F'; % transpose data

% Get matrix size
[m, n] = size(F);

% Create linearly spaced vectors for x and y
% x = linspace(0, 0.5, n);
% y = linspace(1.0, 6.0, m);
% x = linspace(0.8, 0.99, n);
% y = linspace(0, 0.6, m);


% Create meshgrid for plotting if needed
% [X, Y] = meshgrid(x, y);


imagesc(F); % Use default x = 1:20
colormap jet;
colorbar;
axis xy; % Ensures correct orientation
xlabel('Adaptivity parameter \gamma');
ylabel('Momentum parameter \beta');
% title('Colormap with Linear Mapped Axes');
% clim([0 1]); % Set the color limits

% Define custom x-tick positions (column indices)
xtick_pos = [1:20, 21:29];
% Define corresponding custom labels
xtick_labels = [0.80:0.01:0.99, 0.991:0.001:0.999];
% Apply ticks and labels
xticks(xtick_pos);
xticklabels(arrayfun(@(x) sprintf('%.3f', x), xtick_labels, 'UniformOutput', false));

ytick_pos = [1:13];
ytick_labels = [0.00:0.05:0.60];
yticks(ytick_pos);
yticklabels(arrayfun(@(y) sprintf('%.2f', y), ytick_labels, 'UniformOutput', false));


% pcolor(X, Y, F);
% shading interp;
% colormap jet;
% colorbar;
% xlabel('\gamma');
% ylabel('\beta');
% title('Pcolor with Scaled Axes');


% surf(X, Y, F);
% shading interp;
% colormap jet;
% colorbar;
% view(2); % Top-down view
% xlabel('\gamma');
% ylabel('\beta');
% title('Surface Plot with Scaled Axes');